package org.yu.team2023.flashdays.registries;

import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.AbstractContainerMenu;

import javax.annotation.Nonnull;

public abstract class EasyScreen<T extends AbstractContainerMenu> extends AbstractContainerScreen<T> {
    public EasyScreen(T pMenu, Inventory pPlayerInventory, Component pTitle) {
        super(pMenu, pPlayerInventory, pTitle);
        this.imageHeight = getImageHeight();
        this.imageWidth = getImageWidth();
        this.inventoryLabelY = 120;
        init();
    }

    protected abstract int getImageWidth();

    protected abstract int getImageHeight();

    @Override
    public void render(@Nonnull GuiGraphics pPoseStack, int pMouseX, int pMouseY, float pPartialTick) {
        renderBackground(pPoseStack);
        super.render(pPoseStack, pMouseX, pMouseY, pPartialTick);
        renderAfter(pPoseStack, pMouseX, pMouseY, pPartialTick);
        renderTooltip(pPoseStack, pMouseX, pMouseY);
    }

    public abstract void renderAfter(@Nonnull GuiGraphics pPoseStack, int pMouseX, int pMouseY, float pPartialTick);

}
